//
//  MotionEffectViewController.swift
//  Animator
//
//  Created by liu guoqiang on 16/9/10.
//  Copyright © 2016年 liu guoqiang. All rights reserved.
//

import UIKit

class MotionEffectViewController: UIViewController {
    @IBOutlet weak var tree: UIImageView!

    @IBOutlet weak var cowboy: UIImageView!
    @IBOutlet weak var mountain: UIImageView!
    override func viewDidLoad() {
        super.viewDidLoad()
        var mountainEffectX = UIInterpolatingMotionEffect(keyPath: "center.x", type: UIInterpolatingMotionEffectType.TiltAlongHorizontalAxis)
        mountainEffectX.maximumRelativeValue = 50.0
        mountainEffectX.minimumRelativeValue = -50.0
        self.mountain.addMotionEffect(mountainEffectX)
        
        var treeEffectX = UIInterpolatingMotionEffect(keyPath: "center.x", type: UIInterpolatingMotionEffectType.TiltAlongHorizontalAxis)
        treeEffectX.maximumRelativeValue = 100.0
        treeEffectX.minimumRelativeValue = -100.0
        self.tree.addMotionEffect(treeEffectX)
        // Do any additional setup after loading the view.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
